package com.hellobike.haxing.modules.wms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hellobike.haxing.modules.wms.entity.PickTask;
import com.hellobike.haxing.modules.wms.mapper.PickTaskMapper;
import com.hellobike.haxing.modules.wms.service.IPickTaskService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: t_wms_pick_task
 * @Author: haxing-boot
 * @Date:   2020-01-14
 * @Version: V1.0
 */
@Service
public class PickTaskServiceImpl extends ServiceImpl<PickTaskMapper, PickTask> implements IPickTaskService {

    @Override
    public List<PickTask> getByDocOperId(Long docOperId) {
        PickTask s = new PickTask();
        s.setDocOperId(docOperId);
        QueryWrapper<PickTask> wrapper = new QueryWrapper<>(s);
        return baseMapper.selectList(wrapper);
    }

    @Override
    public PickTask getByDocLineIdAndDocOperId(Long lineId, Long docOperId) {
        PickTask s = new PickTask();
        s.setDocOperId(docOperId);
        s.setDocLineId(lineId);
        QueryWrapper<PickTask> wrapper = new QueryWrapper<>(s);
        return baseMapper.selectOne(wrapper);
    }
}
